package com.example.firstboot.service.impl;

import com.example.firstboot.entity.TbHistory;
import com.example.firstboot.entity.selectPAndD;
import com.example.firstboot.mapper.TbHistoryMapper;
import com.example.firstboot.service.TbHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TbHistoryServiceImpl implements TbHistoryService {

    @Autowired
    private TbHistoryMapper tbHistoryMapper;

    @Override
    public List<TbHistory> findAllHistory() {
        return tbHistoryMapper.findAllHistory();
    }

    @Override
    public List<TbHistory> findHistoryByAccount(String account) {
        return tbHistoryMapper.findHistoryByAccount(account);
    }

    @Override
    public List<TbHistory> findHistoryByPAccount(String paccount) {
        return tbHistoryMapper.findHistoryByPAccount(paccount);
    }

    @Override
    public List<selectPAndD> selectPAndD(String daccount) {
        return tbHistoryMapper.selectPAndD(daccount);
    }

    @Override
    public List<TbHistory> searchHistory(String illness_description) {
        return tbHistoryMapper.searchHistory(illness_description);
    }

    @Override
    public int saveHistorys(TbHistory tbHistory) {
        return tbHistoryMapper.saveHistorys(tbHistory);
    }

    @Override
    public int updateHistorys(TbHistory tbHistory) {
        return tbHistoryMapper.updateHistorys(tbHistory);
    }
}
